from pathlib import Path

name = input('请输入名字：')
path = Path('10_chapter_10_test\guest.txt')
path.write_text(name.title())